-----------------------------------
-- Area: Western Adoulin
-- NPC: Neivaig
-- Type: Patrol NPC
-- @zone 256
-- @pos -4.030 6.862 73.300
-----------------------------------
package.loaded["scripts/zones/Western_Adoulin/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/zones/Western_Adoulin/TextIDs");
require("scripts/globals/pathfind");

-----------------------------------

local path = {
    22.939959,0.000000,73.300018,
     21.931276,0.000000,73.300018,
     18.594433,0.000000,73.299988,
     14.378378,0.000000,73.299950,
     13.362350,0.000000,73.299950,
     11.590327,0.000000,73.299950,
     10.517116,0.000000,73.299950,
     7.426925,0.138603,73.299942,
     6.107124,0.578505,73.299934,
     4.732686,1.036594,73.299934,
     3.534697,1.436024,73.299950,
     1.849091,1.998884,73.299950,
     0.800232,2.347340,73.299942,
     -0.255455,2.699461,73.299950,
     -1.447748,3.096803,73.299950,
     -2.537584,3.459962,73.299934,
     -3.558359,3.800238,73.299950,
     -4.611765,4.152643,73.299927,
     -10.651357,6.164628,73.299950,
     -11.877793,6.574643,73.299950,
     -12.894764,6.912539,73.299942,
     -13.950059,7.264112,73.299904,
     -15.144238,7.662265,73.299942,
     -17.040047,8.294195,73.299942,
     -18.062700,8.635082,73.299957,
     -19.146456,8.997539,73.299820,
     -23.600584,10.481187,73.299950,
     -25.226963,11.023104,73.299919,
     -26.261765,11.368220,73.299950,
     -27.279865,11.707463,73.299927,
     -28.284313,12.043363,73.299965,
     -29.421944,12.421395,73.299904,
     -32.279446,13.373960,73.299942,
     -40.133553,16.000000,73.299988,
     -39.132030,15.659485,73.299988,
     -9.122137,5.660431,73.299950,
     20.896252,0.000000,73.299988
};

-----------------------------------
-- onSpawn Action
-----------------------------------

function onSpawn(npc)
	npc:initNpcAi();
	npc:setPos(pathfind.first(path));
	onPath(npc);
end;

-----------------------------------
-- onPath Action
-----------------------------------

function onPath(npc)
	pathfind.patrol(npc, path);
end;

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
player:startEvent(0x022C);
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
	-- printf("CSID: %u",csid);
	-- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
	-- printf("CSID: %u",csid);
	-- printf("RESULT: %u",option);
end;